<?php echo $header; ?>

<!-- Content -->
    <div id="main" class="p13t">
        <?php echo $column_left; ?>
        <div id="col2" class="w709">
          <div class="box_tt">
            <h4 class="float_left p5t"><?php echo $heading_title; ?></h4>
<!--             
            <span class="float_right"><a href="javascript:history.go(-1);"><img src="catalog/view/theme/<?php echo $template; ?>/images/bt_tibage.png"/></a></span>
-->            
		  </div>
          <div class="box_content_underpage">
            <div class="box_content_underpage1 min_heght">
              <div class="text_omos p15t p20r p15b p20l"><?php echo $description; ?></div>
                <div id="main_newsletter">
                    <div class="p15t p20r p15b p20l">
                        <div class="newsletter_page">
                            <h3>Nyhedsbrev</h3>
                            <p>
                                Tilmeld dig vores nyhedsbrev og få 5% i rabat på alle onlinekøb. Vi udsender nyhedsbrev
                                1-2 gange om måneden.
                            </p>
                            <form id="newsletterForm2" method="post" action="<?php echo str_replace('&', '&amp;', $newsletter_action); ?>">
                                <fieldset>
                                    <input type="text" id="subscriber_name2" class="input-txt input-mg" name="subscriber_name" value="Indtast din navn" title="Indtast din navn"/>
                                    <div class="float_left">&nbsp;</div>
                                    <input type="text" id="subscriber_email2" class="input-txt" name="subscriber_email" value="Indtast din email-adresse" title="Indtast din email-adresse"/>
                                    <a id="subscriber_button2" class="submit-btn" name="subscriber" href="">Tilmeld</a>
                                    <a id="unsubscriber_button2" class="submit-btn" href="">Afmeld</a>
                                </fieldset>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
          </div>
          <div class="box_bottom"></div>
        </div>
        <p class="cb"></p>
   </div>
</div>
<!-- End content -->

<script type="text/javascript">
    //var mail_filter2 = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
    var mail_filter2 = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z]{2,6})+$/;

    jQuery('#subscriber_button2').live('click', function (event) {
        event.preventDefault();

        if ((jQuery('#subscriber_name2').val() == '') || (jQuery('#subscriber_name2').val() == jQuery('#subscriber_name2').attr('title'))) {
            confirm('Nyhedsbrev', 'Navn er ugyldig. Indtast en gyldig navn.', 'notify');
            //setTimeout("jQuery('.simplemodal-close').click()", 90000);
            return false;
        }

        if (!mail_filter.test(jQuery('#subscriber_email2').val())) {
            //confirm('Nyhedsbrev', 'E-mail "' + jQuery('#subscriber_email').val() + '" er ugyldig. <br />Indtast en gyldig e-mail-adresse!', 'notify');
            confirm('Nyhedsbrev', 'E-mailen er ugyldig. Indtast en gyldig e-mail.', 'notify');
            //setTimeout("jQuery('.simplemodal-close').click()", 90000);
            return false;
        }

        jQuery.post(
            "<?php echo $subscriber_url; ?>",
            {'email': jQuery('#subscriber_email2').val(), 'name': jQuery('#subscriber_name2').val()},
            function (data) {
                confirm('Nyhedsbrev', data, 'notify');
                //setTimeout("jQuery('.simplemodal-close').click()", 90000);
                jQuery('#subscriber_email2').focus();
            }
        );
        jQuery('#subscriber_email2').val('');
        jQuery('#subscriber_name2').val('');

        return false;
    });

    jQuery('#unsubscriber_button2').live('click', function (event) {
        event.preventDefault();

        if (!mail_filter.test(jQuery('#subscriber_email2').val())) {
            //confirm('Nyhedsbrev', 'E-mail "' + jQuery('#subscriber_email').val() + '" er ugyldig. <br />Indtast en gyldig e-mail-adresse!', 'notify');
            confirm('Nyhedsbrev', 'E-mailen er ugyldig. Indtast en gyldig e-mail.', 'notify');
            //setTimeout("jQuery('.simplemodal-close').click()", 90000);
            return false;
        }

        jQuery.post(
            "<?php echo $unsubscriber_url; ?>",
        {email: jQuery('#subscriber_email').val()},
            function (data) {
                confirm('Nyhedsbrev', data, 'notify');
                //setTimeout("jQuery('.simplemodal-close').click()", 90000);
                jQuery('#subscriber_email2').focus();
            }
        );
        jQuery('#subscriber_email2').val('');
        jQuery('#subscriber_name2').val('');

        return false;
    });
</script>

<!-- footer -->
<?php echo $footer; ?> 